package com.etc.logManage.model;

import java.sql.Timestamp;

import com.etc.common.enums.LoginTypeEnum;
import com.etc.common.enums.UserTypeEnum;
import com.etc.common.model.BaseModel;
import com.etc.common.util.DateUtils;
import com.etc.logManage.vo.LogLoginVO;

/**    
* @Title: LogLoginModel.java  
* @Package com.etc.logManage.model  
* @Description: TODO 
* @author 黄宇    
* @date 2016年3月27日 下午9:28:08  
* @version V1.0    
*/
public class LogLoginModel extends BaseModel{

	private static final long serialVersionUID = -9146896952534224520L;
	
	// id
	private Integer tllId;
	
	// 登录用户
	private String tsuName;
	
	// 登录IP
	private String tllIp;
	
	// 登录类型
	private Integer tllType;
	
	// 登录时间
	private Timestamp tllTime;

	// 用户类型（app用户、网站用户、后台用户）
	private Integer tllUserType;
	
	public Integer getTllUserType() {
		return tllUserType;
	}

	public void setTllUserType(Integer tllUserType) {
		this.tllUserType = tllUserType;
	}

	public Integer getTllType() {
		return tllType;
	}

	public void setTllType(Integer tllType) {
		this.tllType = tllType;
	}

	public void setTllIp(String tllIp) {
		this.tllIp = tllIp;
	}

	public Integer getTllId() {
		return tllId;
	}

	public void setTllId(Integer tllId) {
		this.tllId = tllId;
	}

	public Timestamp getTllTime() {
		return tllTime;
	}

	public void setTllTime(Timestamp tllTime) {
		this.tllTime = tllTime;
	}

	public String getTllIp() {
		return tllIp;
	}

	public String getTsuName() {
		return tsuName;
	}

	public void setTsuName(String tsuName) {
		this.tsuName = tsuName;
	}
	
	public LogLoginVO model2VO(){
		LogLoginVO vo = new LogLoginVO();
		vo.setTllId(String.valueOf(this.tllId));
		vo.setTllIp(this.tllIp);
		vo.setTsuName(this.tsuName);
		vo.setTllTime(DateUtils.getDateStrFromTimestamp(this.tllTime));
		vo.setTllType(LoginTypeEnum.getNameByValue(this.tllType));
		vo.setTllUserType(UserTypeEnum.getNameByValue(this.tllUserType));
		return vo;
	}
	
}
